//引入仓库
import pinia from "@/store";
import useUserInfo from "@/store/modules/user";
let userStore = useUserInfo(pinia);
export const isHasButton = (app: any) => {
  //创建自定义指令
  app.directive("has", {
    //挂载时触发
    mounted(el: any, binding: any) {
      if (!userStore.buttons.includes(binding.value)) {
        //移除自身
        el.parentNode.removeChild(el);
      }
    },
  });
};
